<extend name="Public/base"/>
<block name="style">
    <style type="text/css">
        .btn {

            background: #09c;
        }

        .btn:hover {
            background: #09c;
        }

        .code {
            width: 135px;
            height: 40px;
            border: none;
            background: #4BBD00;
            color: #fff;

        }

        .real_status {
            width: 135px;
            height: 40px;
            border: none;
            background: #4BBD00;
            color: #fff;

        }

        p {
            height: 50px;
            line-height: 50px;
            font-size: 18px;
            margin-top: 20px;
        }

        .side-sub-menu > li > .item {
            color: #000;
            font-family: '宋体';
            font-size: 15px;
            padding: 0px;
            line-height: 25px;
        }

        .sidebar {
            background: #3697A0;
            position: absolute;
        }

        form .form-item {
            width: 50%;

        }

        /* 头部Logo,主导航*/
        body {
            color: #000;
            font-family: '宋体';
            font-weight: 900;
        }

        .header {
            background-color: #3697A0;
            height: 45px;
        }

        /* 主导航 */
        .main-nav a {
            height: 45px;
            color: #150303;
        }

        .main-nav a:hover {
            height: 45px;
            background-color: #70bcf3;
            color: #150303;
        }

        .main-nav .current {
            height: 45px;
            background-color: #70bcf3;
        }

        .main-nav .current a {
            height: 45px;
            background-color: #70bcf3;
            color: #150303;
        }

        .logo {
            height: 45px;
            background: #ccc;
        }

        .sidebar {
            margin-top: -5px;
            background: #3697A0;
            color: #000;
            position: fixed;
            height: 110%;
            margin-top: -40px;
        }

        .subnav h3 {
            color: #000;
        }

        .main-nav {
            /*width:100%;*/
            float: none;
            height: auto;
        }

        .mainnav {
            /*height: auto;*/
            height: 100%;
        }

        .main-nav li {
            float: none;
            width: 180px;
        }


    </style>
</block>
<block name="body">
    <div class="main-title">
        <h2>口碑商户资料</h2>
    </div>


    <form action="{:U()}" method="post" class="form-horizontal">


        <php>

            if(empty($_list['status'])){
            $tatus=0;
            }else{
            $status=1;
            }

        </php>


        <div class="form-item">
            <label class="item-label">码主姓名</label>
            <div class="controls">
                <input type="text" style="height:30px;" class="text input-large" name="name" value="{$_list.name}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">码主支付宝</label>
            <div class="controls">
                <input type="text" style="height:30px;" class="text input-large" name="alipay" value="{$_list.alipay}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">一级分润</label>
            <div class="controls">
                <input type="text" style="height:30px;" class="text input-large" name="rate" value="{$_list.rate}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">码主费率</label>
            <div class="controls">
                <input type="text" style="height:30px;" class="text input-large" readonly name="rate2"
                       value="{$_list.rate2}">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">最小额度</label>
            <div class="controls">
                <input type="text" style="height:30px;" class="text input-large" name="min_quota" value="{$_list.min_quota}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">最大额度</label>
            <div class="controls">
                <input type="text" style="height:30px;" class="text input-large" name="max_quota" value="{$_list.max_quota}">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">每日限额</label>
            <div class="controls">
                <input type="text" style="height:30px;" class="text input-large" name="daylimit_quota" value="{$_list.daylimit_quota}">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">测试二维码</label>
            <div class="controls">
                <img width="200" height="200" src="http://hbxyk.hihaoge.me/home/test/getTestQrcode?id={$_list.id}&amount=1" />
            </div>
        </div>

        <div class="form-item" >
            <label class="item-label">使用状态</span></label>
            <div class="controls">
                <if condition="$_list[use_status] eq 1">
                    <label> <input  type="radio" style="width:20px;height:20px;" checked
                                   class="text input-large" name="use_status" value="1">开</label>
                    <label> <input  type="radio" style="width:20px;height:20px;" class="text input-large"
                                   name="use_status" value="0">关</label>
                    <else/>
                    <label> <input  type="radio" style="width:20px;height:20px;" class="text input-large"
                                   name="use_status" value="1">开</label>
                    <label> <input  type="radio" style="width:20px;height:20px;" checked
                                   class="text input-large" name="use_status" value="0">关</label>

                </if>

            </div>
        </div>

        <!--状态:0=未测试,1=正常,2=异常-->
        <div class="form-item" >
            <label class="item-label">测试状态</span></label>
            <div class="controls">
                <label> <input  type="radio" style="width:20px;height:20px;"
                               class="text input-large" name="status" value="0" <if condition="$_list['status'] eq 0">checked</if> >未测试</label>
                <label> <input  type="radio" style="width:20px;height:20px;" class="text input-large"
                               name="status" value="1" <if condition="$_list['status'] eq 1">checked</if> >正常</label>
                <label> <input  type="radio" style="width:20px;height:20px;" class="text input-large"
                               name="status" value="2" <if condition="$_list['status'] eq 2">checked</if> >异常</label>


            </div>
        </div>

        <div class="form-item" >
            <label class="item-label">审核状态</span></label>
            <div class="controls">
                <label> <input type="radio" style="width:20px;height:20px;"
                               class="text input-large" name="handle_status" value="0" <if condition="$_list['handle_status'] eq 0">checked</if> >未审核</label>

                <label> <input type="radio" style="width:20px;height:20px;" class="text input-large"
                               name="handle_status" value="1" <if condition="$_list['handle_status'] eq 1">checked</if> >审核成功</label>
                <label> <input type="radio" style="width:20px;height:20px;" class="text input-large"
                               name="handle_status" value="2" <if condition="$_list['handle_status'] eq 2">checked</if> >审核失败</label>

            </div>
        </div>

        <div class="form-item">
            <label class="item-label">支付宝appid</label>
            <div class="controls">
                <input type="text" style="height:30px;" class="text input-large" name="appid" value="{$_list.appid}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">支付宝pid</label>
            <div class="controls">
                <input type="text" style="height:30px;" class="text input-large" name="user_id" value="{$_list.user_id}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">支付宝应用私钥</label>
            <div class="controls">
                <textarea type="text" cols="150" rows="12" name="secret" value="{$_list.secret}">{$_list.secret}</textarea>
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">支付宝应用公钥</label>
            <div class="controls">
                <textarea type="text" cols="150" rows="5" name="public" value="{$_list.public}">{$_list.public}</textarea>

            </div>
        </div>



        <div>
            <p><a href="http://hbxyk.hihaoge.me/index.php?m=Admin&c=Alipay&a=kb_dingdan&id={$vo.user_id}" class="button grey" >{$_list.user_id}</a></p>
            <p>交易总金额： {$_list.total_money}</p>
            <p>今日交易总金额：： {$_list.today_money}</p>

        </div>


        <div class="form-item">
            <button class="btn submit-btn" id="submit" type="button" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>

            <span class="btn  sq" style="width:132.167px;height:38px;text-align:center;padding:0px;line-height:38px;">解除授权</span>


        </div>


    </form>
</block>
<block name="script">


    <script type="text/javascript">

        Think.setValue("extend", {$info.extend |
        default
        = 0
        })
        ;
        //导航高亮
        highlight_subnav('{:U('
        index
        ')}'
        )
        ;

        // $('#code').click(function(){
        //     var code=$('.app_auth_code').val();
        //     location.href="{:U('Alipay/get_token?code=')}"+code;
        // })

        $('#submit').click(function () {
            var data = $('form').serializeArray();
            $.ajax({
                type: 'post',
                url: '',
                data: data,
                success: function (m) {
                    if (m >= 1) {
                        alert('修改成功！');
                        location.href = "{:U('index')}";
                    } else if (m == 0) {
                        alert('修改失败！');
                    } else {
                        alert(m)
                    }
                }

            })
        })

        $('.sq').click(function () {

            var app_auth_code = $('.app_auth_code').val();
            // alert(app_auth_code)
            $.ajax({
                type: 'post',
                data: {'app_auth_code': app_auth_code, 'type': 1},
                url: "{:U('shouquan')}",
                success: function (m) {
                    // alert(m)
                    if (m == 1) {
                        alert('解除成功！');
                        location.href = "{:U('index')}";
                    } else if (m == 0) {
                        alert('解除失败！');
                    } else {
                        alert(m)
                    }
                }
            })

        })

    </script>

    <!-- app_auth_token":"201712BBdf7f602ee00f4a6ca88e1116f468bD12","app_refresh_token":"201712BBc70480b713d141529bf20d71c1cb4B12","auth_app_id":"2017051207213149","user_id":"2088721036926123"} -->

</block>

